Skip to content

Comments

Fix #14768 useFetchers breaking on deferred routes with Suspense/Await #14805

Open
Axadali wants to merge 7 commits intoremix-run:mainfrom
Axadali:main
Open

Fix #14768 useFetchers breaking on deferred routes with Suspense/Await #14805
Axadali wants to merge 7 commits intoremix-run:mainfrom
Axadali:main

Conversation

@Axadali
Copy link

@Axadali Axadali commented Feb 16, 2026

Description:

This PR fixes an issue where multiple concurrent useFetcher() submissions would collapse into a single effective inflight fetcher on routes that use deferred loaders with Suspense/Await.

Problem
On deferred routes, only the first fetcher would enter the loading state while others remained in submitting state or vanished entirely, breaking parallel optimistic rendering. This was different from blocking routes where multiple concurrent fetchers worked correctly.

Solution
Modified the getUpdatedRevalidatingFetchers function in packages/react-router/lib/router/router.ts to preserve fetchers that are already in "submitting" or "loading" states during deferred revalidation. The fix adds a condition to only update fetchers that are not already active:

 if (!fetcher || (fetcher.state !== "submitting" && fetcher.state !== "loading")) {
    // Update fetcher state
 }

Changes Made
1. Updated getUpdatedRevalidatingFetchers function to preserve active fetchers during revalidation
2. Added proper test cases to verify the fix works correctly
3. Created changeset file to document the fix

Verification
- Multiple concurrent fetchers now maintain independent states on deferred routes
- Behavior is now consistent between blocking and deferred routes
- All fetchers progress independently: submitting → loading → idle
- Maintains backward compatibility with existing functionality

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Feb 16, 2026

Hi @Axadali,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: f573a9c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Feb 16, 2026

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant